import request from '@/utils/request'

// 获取当前品牌关联的所有分类列表
export function getCatelogList(brandId) {
  return request({
    url: '/product/categorybrandrelation/catelog/list',
    method: 'get',
    params: {brandId:brandId}
  })
}


// 获取当前分类关联的所有品牌列表
export function getBrandsList(catId) {
  return request({
    url: '/product/categorybrandrelation/brands/list',
    method: 'get',
    params: {catId:catId}
  })
}


// 查询品牌分类关联下拉树列表
export function listcategorybrandrelation(params) {
  return request({
    url: '/product/categorybrandrelation/list',
    method: 'get',
    params: params
  })
}

// 新增品牌分类关联
export function addcategorybrandrelation(data) {
  return request({
    url: '/product/categorybrandrelation/save',
    method: 'POST',
    data: data
  })
}


// 修改品牌分类关联
export function updatecategorybrandrelation(data) {
  return request({
    url: '/product/categorybrandrelation/update',
    method: 'POST',
    data: data
  })
}

// 修改品牌分类关联状态
export function updatecategorybrandrelationStatus(data) {
  return request({
    url: '/product/categorybrandrelation/update/status',
    method: 'POST',
    data: data
  })
}

// 批量修改品牌分类关联
export function updatecategorybrandrelationBatch(data) {
  return request({
    url: '/product/categorybrandrelation/update/sort',
    method: 'POST',
    data: data
  })
}


// 查询品牌分类关联
export function getcategorybrandrelationById(id) {
  return request({
    url: '/product/categorybrandrelation/info/'+id,
    method: 'GET'
  })
}


// 批量删除品牌分类关联
export function delcategorybrandrelationByIds(ids) {
  return request({
    url: '/product/categorybrandrelation/delete',
    method: 'delete',
    data: ids
  })
}
